///--------------------------------------------------------------------
/// <file name="Namespace.js">
///   Defines the namespace for the NAMFox add-on so JavaScript objects
///   don't conflict in the global namespace.
/// </file>
///--------------------------------------------------------------------

var NAMFox = {};

(function() {
    var namespaces = [];
    var initialized = false;
            
    this.ns = function(fn) {
        namespaces.push(fn);
    };
    
    this.init = function() {
        if (initialized) {
            return;
        }
        
        initialized = true;
        for (var i = 0; i < namespaces.length; ++i) {
            var fn = namespaces[i];

            fn.apply(NAMFox);
        }
    };
}).apply(NAMFox);

window.addEventListener("load", NAMFox.init, false);
